from threading import Thread
import time


class MyThread(Thread):
    def __init__(self, value):
        self.value = value
        super().__init__()

    def run(self):
        for i in range(self.value):
            time.sleep(2)
            print("自定义类")


t = MyThread(3)
t.start()
